<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * components/com_summercamps/summercamps.php
 * @license    Eclipse
*/

// No direct access //security check
defined( '_JEXEC' ) or die( 'Restricted access' );
 
// Require the base controller
//JPATH_COMPONENT would be something like components/com_summercamps/
//DS stands for Directory Separator, and separates the directories using
//	either a forward or backward slash
require_once( JPATH_COMPONENT.DS.'controller.php' );
 
// Require specific controller if requested
//getWord('controller') retrieves "test" from
//index.php?controller=test
if($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}
 
// Create the controller
$classname    = 'SummerCampsController'.$controller;
$controller   = new $classname();
 
// Perform the Request task
$controller->execute(JRequest::getWord('task'));
 
// Redirect if set by the controller
$controller->redirect();